package common_enum

// 通用-上传状态
type commonUploadStatus int

var CommonUploadStatus commonUploadStatus

// 未上传
func (c *commonUploadStatus) Not() int {
	return 1
}

// 已上传
func (c *commonUploadStatus) Done() int {
	return 2
}

// 上传失败
func (c *commonUploadStatus) Fail() int {
	return 3
}

// 不用上传
func (c *commonUploadStatus) NotNeed() int {
	return 4
}

func (c *commonUploadStatus) ToText(value int) string {
	switch value {

	case 1:
		return "未上传"

	case 2:
		return "已上传"

	case 3:
		return "上传失败"

	case 4:
		return "不用上传"

	}
	return ""
}

func (c *commonUploadStatus) ToValue(text string) int {
	switch text {

	case "未上传":
		return 1

	case "已上传":
		return 2

	case "上传失败":
		return 3

	case "不用上传":
		return 4

	}
	return 0
}
